home *** CD-ROM | disk | FTP | other *** search
-
- NAME
- Timer -- Measure the execution time of a CLI program (V37)
-
- SYNOPSIS
- Timer command_line_to_execute
-
- FUNCTION
- Timer measures the time a CLI program takes to do it's job. It uses
- the timer.device GetSysTime() function before and after running the
- program by calling to the dos.library System() function, and then
- prints the difference between the two times.
-
- The program executed by Timer inherits it's stack size. Other
- parameters retain their default value as set by System().
-
- INPUTS
- command_line_to_execute - A normal command line, for example 'Copy
- DH0: RAM: all quiet'.
-
- RESULT
- '*** Time: %ld.%06ld secs'
-
- Timer passes to the shell the return code of the executed program.
-
- NOTES
- Experimentation shows that Timer's timings are accurate down to about
- 1/50th of a second.
-
- You might want to redirect Timer's output, your program's output, or
- both. The 2.0 shell interprets a redirection command such as '>T:tmp'
- no matter where it is on the command line, so something like
-
- Timer Dir >T:tmp
-
- would result in Timer's AND Dir's output going to T:tmp. To redirect
- Dir to T:tmp and retain Timer's output on the shell, which was
- probably what you meant, you should do
-
- Timer >* Dir >T:tmp
-
- (in other words, redirect Timer to the shell window). Obviously,
- reversing the file names reverses the effect.
-
- EXAMPLES
- These examples show Timer's and OS's overhead on a 68000 Amiga under
- Kickstart 39.106:
-
- > Timer
- *** Time: 0.199686 secs
- > Timer NOP
- *** Time: 0.254926 secs
- [NOP is a silly program that simply clears D0 and RTS's]
- > Timer Wait 5
- *** Time: 5.373808 secs
- > Timer Wait 10
- *** Time: 10.478978 secs
- > Timer Wait 50
- *** Time: 50.365576 secs
-
- DISTRIBUTION
- This program is freeware. You may redistribute it as long as:
- - this text and the source code are included;
- - you don't charge more than a nominal copying fee for distribution.
-
- Please state your modifications to the code with a clear comment, and
- send me your modified version. It would be a good idea to include
- the original code, anyway.
-
- Any contribution will be greatly appreciated (I'm a poor engineering
- student, you know).
-
- DISCLAIMER
- The author does not assume any responsibility for damages which could
- result by the use of this program. The entire risk for the use of
- this program is assumed by the user.
-
- AUTHOR
- Flavio Stanchina
- Loc. Montevaccino, 39
- 38040 Trento (Italia)
-
- email: 2:333/408.9@fidonet.org
-
-